using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Spire.Presentation.Drawing;

namespace Spire.Presentation.Demo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
            //create PPT document
            Presentation presentation = new Presentation();

            //load PPT file from disk
            presentation.LoadFromFile(@"..\..\..\..\..\..\Data\HelloWorld.pptx");

            IAutoShape shape = (IAutoShape) presentation.Slides[0].Shapes[0];
            shape.AppendTextFrame("The text here has been edited.");

            //set the color of background
            presentation.Slides[0].SlideBackground.Type = BackgroundType.Custom;
            presentation.Slides[0].SlideBackground.Fill.FillType = FillFormatType.Solid;
            presentation.Slides[0].SlideBackground.Fill.SolidColor.Color = Color.FromArgb(180, 38, 183, 255);

            //save the document
            presentation.SaveToFile("Editing.pptx", FileFormat.Pptx2007);
            System.Diagnostics.Process.Start("Editing.pptx");

        }
    }
}